$OpenBSD: patch-bin_package,v 1.1.1.1 2012/10/13 15:11:51 pascal Exp $
--- bin/package.orig	Fri Aug 10 21:22:28 2012
+++ bin/package	Fri Aug 10 21:23:14 2012
@@ -2823,7 +2823,7 @@ cat $INITROOT/$i.sh
 			# check if $CC (full path $cc) is a cross compiler
 
 			(
-				cd /tmp || exit 3
+				cd ${TMPDIR:-/tmp} || exit 3
 				cp $INITROOT/hello.c pkg$$.c || exit 3
 				$cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || {
 					if $cc -Dnew=old -o pkg$$.exe pkg$$.c > /dev/null 2>&1
@@ -3193,7 +3193,7 @@ cygwin.*)
 		lose=ntsec
 		;;
 	*ntsec*);;
-	*)	exe=/tmp/pkg$$.exe
+	*)	exe=${TMPDIR:-/tmp}/pkg$$.exe
 		rm -f $exe
 		: > $exe
 		if	test -x $exe
